import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import My from '@/views/My'
import News from '@/views/News'
import Search from '@/views/Search'
import Home from '@/views/Home'
import Layout from '@/views/Layout'
import City from '@/views/City'
import Detail from '@/views/Detail'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    redirect: '/Login'
  },
  {
    path: '/layout',
    component: Layout,
    redirect: '/layout/home',
    children: [
      {
        path: 'home',
        component: Home
      },
      {
        path: 'my',
        component: My

      },
      {
        path: 'search',
        component: Search
      },
      {
        path: 'news',
        component: News
      }

    ]
  },
  {
    path: '/city',
    component: City
  },
  {
    path: '/detail',
    component: Detail
  },
  {
    path: '/login',
    component: Login

  }

]

const router = new VueRouter({
  routes
})

export default router
